package com.liu.test;

import com.liu.rabbitmq.RabbitMqApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * 测试主题模式
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = RabbitMqApplication.class)
public class ProducerTest3 {

    @Autowired
    private RabbitTemplate rabbitTemplate;


    @Test
   public void sendMsgtopic01() {

        rabbitTemplate.convertAndSend("topictest","good.aaa","主题模式");
        //
   }

    @Test
    public void sendMsgtopic02() {

        rabbitTemplate.convertAndSend("topictest","123.fdf.log","主题模式");

    }

    @Test
    public void sendMsgtopic03() {

        rabbitTemplate.convertAndSend("topictest","good.log","主题模式");

    }



}
